package com.ssy.lingxi.report.model.constant.settleaccount;

import java.util.Arrays;

/**
 * 收据发票支付状态
 * @author 伍将
 * @date 2020/10/28
 * @version 2.0.0
 */
public enum ReceiptInvoicePayStatusEnum {

    /**
     * 所有
     */
    ALL(2, "所有支付状态"),
    /**
     * 未支付
     */
    NO(0, "未支付"),
    /**
     * 已支付
     */
    YES(1, "已支付");

    private final Integer code;
    private final String message;

    ReceiptInvoicePayStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(ReceiptInvoicePayStatusEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(ALL).getMessage();
    }
}
